home *** CD-ROM | disk | FTP | other *** search
/ CD ROM Paradise Collection 4 / CD ROM Paradise Collection 4 1995 Nov.iso / win / copystop.zip / COPYSTOP.DOC < prev    next >
Text File  |  1995-01-31  |  7KB  |  150 lines

  1. Description
  2.  
  3. COPYSTOP is a utility which may be called by any Visual Basic 2.0 or 3.0 
  4. application using the SHELL keyword. COPYSTOP will return a two digit
  5. code to indicate whether the application is running on the machine on
  6. which it was first installed. The programmer may then take any chosen action
  7. if it is discovered that the application has been copied on to a different
  8. machine. The aim is to provide the Visual Basic developer with a ready 
  9. means of discouraging wholesale copying of his/her products.
  10.  
  11. The COPYSTOP package comprises:
  12.  
  13. 1. The COPYS200.EXE executable module which requires VBRUN200.DLL.
  14.  
  15. 2. The COPYS300.EXE executable module which requires VBRUN300.DLL.
  16.  
  17. Only one of these modules would be used in a particular application
  18. depending on which version of Visual Basic is in use.
  19.  
  20. 3. Sample code to be included in your VB application to invoke the 
  21.    COPYSTOP executable and receive the results.
  22.  
  23. 4. An "unlock" utility (UL200.EXE and UL300.EXE) to allow the programmer 
  24.    to reset the COPYSTOP protection. Without this it would be difficult 
  25.    to experiment with the procedure during program development.
  26.  
  27. Method of operation
  28.  
  29. COPYSTOP works in the following way. 
  30.  
  31. The relevant COPYSn00.EXE executable is distributed with the application and 
  32. copied into the same directory as the Visual Basic application during Setup. 
  33.  
  34. Code should be included in the application to run the COPYn00.EXE 
  35. using the SHELL keyword (see below). **It is very important not to change 
  36. the name of any of the files in the COPYSTOP package**.
  37.  
  38. The first time that COPYSTOP is called by the application it creates 
  39. a hidden file in the root directory of the disc on which it runs. Into 
  40. this it inserts a randomly generated identification number (note that 
  41. in the unregistered version the hidden file is created in the local 
  42. not the root directory.)
  43.  
  44. During this initial run, the serial number is also recorded in the
  45. COPYSn00.EXE executable code.
  46.  
  47. On subsequently running the application, the hidden file is accessed and the 
  48. serial number is checked. If it matches, an appropriate code is returned to
  49. the application. If the wrong number is found a different code is sent.
  50. If no hidden file is found, as might be the case if the application had 
  51. been copied to another machine, a separate descriptive code is sent. These 
  52. codes are described in more detail below. The programmer/ developer is free
  53. to formulate his/her own response to these codes.
  54.  
  55. Once the serial number has been installed during the initial run, COPYSTOP 
  56. will only return a favourable code if the same number is found on subsequent 
  57. runs. If it does not find the hidden file, COPYSTOP will not create another. 
  58. Once run, therefore, the procedure is locked into a fixed expectation of 
  59. finding the originally allocated serial number. It is obviously necessary 
  60. to provide the developer, who must supply a virgin version of the COPYSTOP 
  61. executable with each copy of his application, with a means of resetting 
  62. the procedure. An "unlock" utility, ULn00.EXE, is supplied to meet this need. 
  63. The role of ULn00.EXE is to delete the hidden security file and to reset 
  64. COPYSn00.EXE's memory of having ever created such a file. Be sure only to 
  65. use UL200.EXE with COPYS200.EXE  and UL300.EXE with COPYS300.EXE, or else
  66. things can get into a twist. Any such twist is usually sorted out by running
  67. the other UL.
  68.  
  69. In this, unregistered, version a Message Box (pleading for registration!)
  70. is displayed when COPYSTOP is invoked. A version without this feature 
  71. is supplied to registered users.
  72.  
  73. Example code
  74.  
  75. The following code should be included in your application. An appropriate
  76. place would be at the beginning of the Form_load procedure for the first
  77. form in the application.
  78.  
  79. The form containing this code should have on it a TextBox to
  80. receive the codes returned by COPYSTOP. This should have the focus i.e. the
  81. box should be visible and the cursor should be flashing in it prior to
  82. issuing the Shell command. The box may be made inconspicuous by making
  83. it very small and setting its visible property to FALSE immediately after
  84. use. Alternatively, you may make use of any other text box which happens
  85. to be present on that form. Assuming this box is called TEXT1 and the 
  86. first form in your application is FORM1, the following code is needed.
  87.  
  88. dim code1 as integer
  89. dim code2 as integer
  90. form1.show
  91. text1.visible =true
  92. text1.setfocus
  93. t=Shell("copys200.exe")  
  94. 'or t=Shell("copys300.exe") depending on which VB you are using.
  95. check:
  96. If len(text1.text) > 2 then
  97.         code1=val(left$ (text1.text,2))
  98.         code2=val(right$(text1.text,2))
  99. else
  100.         doevents
  101.         goto check
  102. endif
  103. text1.visible=false
  104.  
  105. This loop waits until COPYSTOP responds and then determines the values
  106. of code1 and code2, these have the following meanings.
  107.  
  108. If code1 is 0, no hidden security file was found.
  109. If code1 is 1, a hidden security file was found.
  110. If code2 is 0, either the wrong serial number was found in the file or,
  111.                this is not the first time COPYSTOP has been asked to 
  112.                create a security file and may, therefore, be running on a
  113.                new host.
  114. If code2 is 1, a correct serial number was found in a hidden file or,
  115.                this is the first time COPYSTOP has been asked to create
  116.                a security file.
  117.  
  118. Thus, code2=1 is the necessary condition for legal use of the application.
  119. Your application could react to a failure to receive this signal by either 
  120. closing down or simply issuing a mild rebuke - its up to you.
  121.  
  122. ---------------------------------------------------------------------------
  123. Registration
  124. Registered users will be sent a version of COPYSTOP without the registration
  125. message box. An appropriate version of the UNLOCK utility is also supplied.
  126.  
  127. Registered users of COPYSTOP acquire the royalty-free right to distribute 
  128. the COPYSTOP executable module as part of ONE bona-fide Visual Basic 
  129. application. The UNLOCK executable module may not be passed on to any third
  130. party under any circumstances. Copyright of all COPYSTOP and UNLOCK code and 
  131. documentation is retained by me. 
  132.  
  133. Users wishing to register should send £6 (six pounds sterling) or $10 to:
  134.  
  135. John Crabb
  136. Pax
  137. Bishopswood
  138. CHARD
  139. Somerset TA20 3SD
  140. UK
  141. (queries to email J.A.Crabb@exeter.ac.uk)
  142.  
  143. I may also send a postcard from rural Somerset!
  144.  
  145. Developers wishing to use the system with further applications should send 
  146. a licence extension fee of £3 or $5 along with the name of the new 
  147. application.
  148.  
  149. ----------------------------------------------------------------------------
  150.